version : "3"

services:
  web-server:
    build         : .
    ports         :
      - "555:555"
    networks      :
      - microservices-network
    depends_on    :
      - database-server
    environment   :
      OWNER:    makarov
      DB_USER:  makarov
      DB_PASS:  makarov_password
      DB_HOST:  database-server:3306
      DB_NAME:  catalog
    container_name:
      web-server

  database-server:
    image         :
      mysql:latest
    ports         :
      - "3306:3306"
    volumes       :
      - ./data:/var/lib/mysql
    networks      :
      - microservices-network
    environment   :
      MYSQL_ROOT_PASSWORD:  root_password
      MYSQL_DATABASE:       catalog
      MYSQL_USER:           makarov
      MYSQL_PASSWORD:       makarov_password
    container_name:
      database-server

networks:
  microservices-network:
    driver: bridge
